<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
int i=1;
%>

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="content-type" content="text/html; charset=UTF-8">
<title>Title</title>


<link href="res/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
<link href="res/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="res/my.css" rel="stylesheet">


</head>
<body>

	<!--导航-->
	<jsp:include page="nav.jsp" />


	<!--banner-->
	<jsp:include page="banner.jsp" />
	
	
	
	<!--内容-->


	<div class="container">

		<div class="row">

			<div class="col-xs-8">
				<div class="page-header">
					<h2>
						${requestScope.newsType.name } <small>最新前沿资讯</small>
					</h2>
					<!--具体新闻-->
					<c:forEach items="${requestScope.news }" var="item">
						<div class="row my-news">
							<div class="col-xs-4">
								<img style="width: 180px; height:135px" class="img-thumbnail" src="<%=basePath %>upload/${item.photo}">
							</div>
							<div class="col-xs-8">
								<h4 class="title my-news-title">${item.title }</h4>
								<p class="st-author">
									<i class="fa fa-calendar"></i>&nbsp;<span>${item.st }</span>&nbsp;<i class="fa fa-group"></i>&nbsp;<span>${item.author }</span>
								</p>
								<p class="brower-count">
									<i class="fa fa-eye">浏览量</i>&nbsp;<span>${item.browserCount }</span>
								</p>
							</div>
						</div>
					</c:forEach>
				</div>

				<!--分页-->
				<nav aria-label="Page navigation">
					<ul class="pagination">
						<li><a href="#" aria-label="Previous"> <span
								aria-hidden="true">&laquo;</span>
						</a></li>
						<li><a href="#">1</a></li>
						<li><a href="#" class="active">2</a></li>
						<li><a href="#">3</a></li>
						<li><a href="#">4</a></li>
						<li><a href="#">5</a></li>
						<li><a href="#" aria-label="Next"> <span
								aria-hidden="true">&raquo;</span>
						</a></li>
					</ul>
				</nav>
			</div>


			<div class="col-xs-4">

				<div class="list-group" style="margin-top: 40px">
					<a class="list-group-item active"> 最新的10条新闻 </a>
					<c:forEach items="${newsTop10 }" var="item">
						<a href="#" class="list-group-item">${item.title }</a> 
					</c:forEach>	
				</div>

				<div class="list-group" style="margin-top: 40px">
					<a class="list-group-item active"> 浏览量最多的10条新闻 </a> 
					<c:forEach items="${newsBrowserCountTop10 }" var="item" varStatus="status">
					<%i++; %>
						<a href="#" class="list-group-item">
							<span class="badge" style="background-color: #df6813;float: left">${status.count }</span>&nbsp;${item.title }
						</a> 
					</c:forEach>	

				</div>

			</div>


		</div>


	</div>





	<!--脚注-->
	<jsp:include page="footer.jsp" />

</body>


</html>

<script src="res/jquery/dist/jquery.js"></script>
<script src="res/bootstrap/dist/js/bootstrap.js"></script>
<script src="res/STAR-ZERO-jquery-ellipsis/dist/jquery.ellipsis.js"></script>

<script>

    $(function () {

        $('.title').ellipsis({
            row: 2
        });

    });


</script>
